<!--
 * @Author: your name
 * @Date: 2021-07-28 10:45:31
 * @LastEditTime: 2021-11-12 15:02:08
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \jinfengts\src\pages\myLaunch\myLaunch.vue
-->
<template>
  <div>
    <!-- 数据展示部分 -->
    <div class="FeedbackDatas">
      <div class="aboutOptions">
        <el-popover placement="bottom-start" width="152" trigger="click">
          <el-checkbox-group v-model="colOptions" :min="3">
            <el-checkbox v-for="item in colSelect" :label="item" :key="item"></el-checkbox>
          </el-checkbox-group>
          <el-button slot="reference" type="primary" size="small" style="margin-left: 10px; margin-bottom: 10px"
            >字段管理</el-button
          >
        </el-popover>
      </div>
      <el-table
        height="600"
        :data="commonTableData"
        style="width: 100%"
        ref="tableDataRef"
        class="feedBackDataTable"
        :default-sort="{ prop: 'lastModifedAt', order: 'descending' }"
        :cell-style="{ textAlign: 'center', height: '60px' }"
        :header-cell-style="{
          textAlign: 'center',
          height: '50px',
          backgroundColor: '#FFFFFF'
        }"
      >
        <el-table-column prop="beyondMarkType" label="超期标识" v-if="colData[0].istrue" sortable width="100">
          <template slot="header">
            <el-tooltip effect="dark" placement="top">
              <div slot="content">
                超期标识注释:<br />绿色：未超期<br />蓝色：反馈普通超期<br />橙色：FEMS普通超期<br />红色：严重超期
              </div>
              <span>超期标识</span>
            </el-tooltip>
          </template>
          <template slot-scope="scope">
            <RadioStatusBtn :isClass="true" :type="scope.row.beyondMarkType"> </RadioStatusBtn>
          </template>
        </el-table-column>
        <el-table-column prop="ctag" label="C1/C2标识" v-if="colData[1].istrue">
          <template slot="header">
            <el-tooltip effect="dark" content="创建订单自动生成的编号" placement="top">
              <div slot="content">C1/C2标识注释:<br />C1：现场问题分析解决<br />C2：改进/优化</div>
              <span>C1/C2标识</span>
            </el-tooltip>
          </template>
          <template slot-scope="scope">
            <span v-if="scope.row.ctag == 0 && scope.row.ctag != null">C1</span>
            <span v-else-if="scope.row.ctag == 1 && scope.row.ctag != null">C2</span>
            <span v-else-if="scope.row.ctag != null">C1/C2</span>
            <span v-else></span>
          </template>
        </el-table-column>
        <el-table-column prop="linkType" label="反馈类型" v-if="colData[2].istrue">
          <template slot-scope="scope">
            {{ scope.row.linkType | transferSeverity(linkType) }}
          </template>
        </el-table-column>
        <el-table-column prop="feedBackNumber" label="反馈ID" sortable width="90" v-if="colData[3].istrue">
          <template slot-scope="scope">
            <span v-if="scope.row.readOnly == false" @click="tofeedBack(scope.row)" class="toPageLink">{{
              scope.row.feedBackNumber
            }}</span>
            <span v-else @click="tofeedBackWithoutBtn(scope.row)" class="toPageLink">{{
              scope.row.feedBackNumber
            }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="productName" label="产品名称" v-if="colData[4].istrue"> </el-table-column>
        <el-table-column prop="title" label="标题" v-if="colData[5].istrue" width="200">
          <template slot-scope="scope">
            <el-tooltip :content="scope.row.title" placement="top" effect="light">
              <span class="aboutTitle">{{ scope.row.title }}</span>
            </el-tooltip>
          </template>
        </el-table-column>
        <el-table-column prop="influenceCategory" label="影响类别" v-if="colData[6].istrue"> </el-table-column>
        <el-table-column label="C1状态" v-if="colData[7].istrue" prop="c1Status"> </el-table-column>
        <el-table-column label="C2状态" v-if="colData[8].istrue" prop="c2Status">
          <template slot-scope="scope">
            <TaskStatusBtn :isClass="true" :type="scope.row.c2Status" :flowStatusList="C2status"></TaskStatusBtn>
          </template>
        </el-table-column>

        <el-table-column label="阶段超期标识" prop="stageOverdueTag" v-if="colData[9].istrue">
          <template slot-scope="scope">
            {{ scope.row.stageOverdueTag | transferSeverity(StageOverdueTagEnum) }}
          </template>
        </el-table-column>
        <el-table-column prop="stage" label="所处阶段" v-if="colData[10].istrue">
          <template slot-scope="scope">
            <span
              v-if="
                scope.row.c1StatusId == '1423154128074436609' &&
                  (scope.row.c2Status == 0 || scope.row.c2Status == 2 || scope.row.c2Status == 3)
              "
              >长期跟踪中</span
            >
            <span v-else-if="scope.row.c1StatusId == '1423154128074436609' && scope.row.c2Status == 1">已完成</span>
            <span v-else>{{ scope.row.stage }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="assignedUser" label="指派给" v-if="colData[11].istrue">
          <template slot-scope="scope">
            <span v-if="scope.row.feedBackStatus == 2">Closed</span>
            <span v-else> {{ scope.row.assignedUser }} </span>
          </template>
        </el-table-column>
        <el-table-column prop="lastModifedAt" label="最后更新时间" v-if="colData[12].istrue" width="140" sortable>
          <template slot-scope="scope">
            <span v-if="scope.row.lastModifedAt">{{ scope.row.lastModifedAt }}</span>
            <span v-else>{{ scope.row.createTime | formatTimer }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="creator" label="创建人" v-if="colData[13].istrue"> </el-table-column>
        <el-table-column prop="creatorDepartment" label="创建部门" v-if="colData[14].istrue"> </el-table-column>

        <!-- TODO: 待后端更改字段配置信息-->
        <el-table-column prop="serverRequestTag" label="是否服务请求" v-if="colData[15].istrue">
          <template slot-scope="scope">
            {{ scope.row.serverRequestTag | transferSeverity(serverRequestTagEnum) }}
          </template>
        </el-table-column>
        <el-table-column label="营销项目名称" prop="marketProjectName" v-if="colData[16].istrue"> </el-table-column>
        <el-table-column label="营销项目状态" prop="marketProjectStatus" v-if="colData[17].istrue"> </el-table-column>

        <el-table-column label="版本号" prop="versionNumber" v-if="colData[18].istrue"> </el-table-column>
        <el-table-column label="反馈来源" prop="feedBackSource" v-if="colData[19].istrue"> </el-table-column>
        <el-table-column label="问题类别" prop="problemTypeParent" v-if="colData[20].istrue"> </el-table-column>

        <el-table-column label="操作" width="155" fixed="right">
          <template slot-scope="scope">
            <div v-if="scope.row.readOnly == false">
              <el-tooltip class="item" effect="light" content="持续处理" v-has="'M1102071'" placement="bottom-start">
                <span class="option_contine" @click="seriousDelate(scope.row)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="删除"
                v-show="scope.row.draftTag && scope.row.stageId != '1423154076169924610'"
                v-has="'M1102058'"
                placement="bottom-start"
              >
                <span class="option_delete" @click="deleteRow(scope.row.id)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="确认"
                v-show="scope.row.draftTag === false && scope.row.stageId === '1423154037607493634'"
                v-has="'M1102060'"
                placement="bottom-start"
              >
                <span class="option_confirm" @click="confirmRow(scope.row.id)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="回退"
                v-show="scope.row.draftTag === false && scope.row.stageId === '1423154037607493634'"
                v-has="'M1102061'"
                placement="bottom-start"
              >
                <span class="option_reback" @click="rebackRow(scope.row.id)" style="pointer-evevnts: none"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="激活"
                v-show="(scope.row.feedBackStatus === 2 || scope.row.feedBackStatus === 3) && scope.row.draftTag === false"
                placement="bottom-start"
                v-has="'M1102059'"
              >
                <span class="option_life" @click="startRow(scope.row.id)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="中止"
                v-show="
                  scope.row.draftTag === false &&
                    scope.row.feedBackStatus === 1 &&
                    scope.row.stageId != '1423154037607493634'
                "
                v-has="'M1102047'"
                placement="bottom-start"
              >
                <span class="option_suspend" @click="suspendRow(scope.row.id)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="关闭"
                v-show="
                  scope.row.draftTag === false &&
                    scope.row.feedBackStatus === 1 &&
                    scope.row.stageId != '1423154037607493634'
                "
                v-has="'M1102048'"
                placement="bottom-start"
              >
                <span class="option_close" @click="closeRow(scope.row.id, scope.row.feedBackNumber)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="更新进度"
                v-show="scope.row.draftTag === false && scope.row.stageId != '1423154037607493634'"
                v-has="'M1102049'"
                placement="bottom-start"
              >
                <span class="option_update" @click="updateRow(scope.row)"></span>
              </el-tooltip>
              <!-- TODO: 严重超期反馈 --持续处理按钮  -->
              <!-- <el-tooltip
              class="item"
              effect="light"
              content="更新进度"
              v-has="'M1102049'"
              placement="bottom-start"
            >
              <span class="option_update" @click="updateRow(scope.row)"></span>
            </el-tooltip> -->
              <el-dropdown
                placement="bottom"
                :hide-timeout="500"
                v-show="
                  !scope.row.draftTag &&
                    scope.row.feedBackStatus != (2 || 3) &&
                    scope.row.feedBackStatus === 1 && scope.row.stageId != '1423154037607493634'
                "
              >
                <span class="option_more"></span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item v-has="'M1102050'" v-show="scope.row.continueToBeTag" class="applicationItem"
                    ><span class="hoverMenuItem application"></span
                    ><span @click="application(scope.row)">申请上会</span></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1102051'" class="turnTaskItem">
                    <span class="hoverMenuItem turnTask"></span><span @click="taskRow(scope.row)">转任务</span>
                  </el-dropdown-item>
                  <el-dropdown-item v-has="'M1102052'" class="turnDemandItem"
                    ><span class="hoverMenuItem turnDemand"></span
                    ><span @click="demandRow(scope.row)">转需求</span></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1102053'" class="turnBugItem"
                    ><span class="hoverMenuItem turnBug"></span
                    ><span @click="bugRow(scope.row)">转BUG</span></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1102055'" class="creatFeedItem"
                    ><span class="hoverMenuItem creatFeed"></span
                    ><span @click="creatFeedRow(scope.row.id)">绑定反馈</span></el-dropdown-item
                  >
                  <el-dropdown-item
                    v-has="'M1102056'"
                    class="transferItem"
                    v-show="
                      scope.row.draftTag === false &&
                        scope.row.feedBackStatus === 1 &&
                        scope.row.stageId != '1423154037607493634'
                    "
                    ><span class="hoverMenuItem transfer"></span
                    ><span @click="transferRow(scope.row.id, scope.row.productId)">转让</span></el-dropdown-item
                  >
                  <el-dropdown-item class="creatFeedItem"
                    ><span class="hoverMenuItem creatFeed"></span
                    ><span @click="bugRows(scope.row.feedBackNumber)">绑定BUG</span></el-dropdown-item
                  >
                  <el-dropdown-item class="creatFeedItem"
                    ><span class="hoverMenuItem creatFeed"></span
                    ><span @click="needRow(scope.row.feedBackNumber)">绑定需求</span></el-dropdown-item
                  >
                </el-dropdown-menu>
              </el-dropdown>
              <!-- C2标识判断 -->
              <!-- <template v-if="
                scope.row.feedBackStatus == 2 &&
                scope.row.operationStatus == 2 &&
                scope.row.ctag == 'C2'
              "
            >
              <el-tooltip
                class="item"
                effect="light"
                content="中止"
                v-has="'M1103005'"
                placement="bottom-start"
              >
                <span
                  class="option_suspend"
                  @click="suspendRow(scope.row.id)"
                ></span>
              </el-tooltip>
              <el-tooltip class="item"
                          effect="light"
                          v-show="!(scope.row.ctag === 'C2' && scope.row.c2Status !== 3)"
                          content="关闭"
                          v-has="'M1103006'"
                          placement="bottom-start">
                <span class="option_close"
                      @click="closeRow(scope.row.id,scope.row.feedBackNumber)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="更新进度"
                v-has="'M1103007'"
                placement="bottom-start"
              >
                <span
                  class="option_update"
                  @click="updateRow(scope.row)"
                ></span>
              </el-tooltip>
              <el-dropdown placement="bottom" :hide-timeout="500">
                <span class="option_more"></span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item v-has="'M1103008'"
                    ><span class="hoverMenuItem application"></span
                    ><span @click="application(scope.row)"
                      >申请上会</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103009'">
                    <span class="hoverMenuItem turnTask"></span
                    ><span @click="taskRow(scope.row)">转任务</span>
                  </el-dropdown-item>
                  <el-dropdown-item v-has="'M1103010'"
                    ><span class="hoverMenuItem turnDemand"></span
                    ><span @click="demandRow(scope.row)"
                      >转需求</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103011'"
                    ><span class="hoverMenuItem turnBug"></span
                    ><span @click="bugRow(scope.row)"
                      >转BUG</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-if="isDelate" v-has="'M1103012'"
                    ><span class="hoverMenuItem isDelate"></span
                    ><span>严重超期</span></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103013'"
                    ><span class="hoverMenuItem creatFeed"></span
                    ><span @click="creatFeedRow(scope.row.id)"
                      >绑定反馈</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103014'"
                    ><span class="hoverMenuItem transfer"></span
                    ><span
                      @click="transferRow(scope.row.id, scope.row.productId)"
                      >转让</span
                    ></el-dropdown-item
                  >
                </el-dropdown-menu>
              </el-dropdown>
            </template> -->
              <!-- TODO -->

              <!-- 判断2 -->
              <!-- <template v-else-if="scope.row.feedBackStatus == 3 || scope.row.feedBackStatus == 2">
              <el-tooltip class="item"
                          effect="light"
                          content="激活"
                          placement="bottom-start"
                          v-show="scope.row.c1Status === 'C1已关闭'"
                          v-has="'M1103017'">
                <span class="option_life"
                      @click="startRow(scope.row.id)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="更新进度"
                v-has="'M1103007'"
                placement="bottom-start"
              >
                <span
                  class="option_update"
                  @click="updateRow(scope.row)"
                ></span>
              </el-tooltip>
            </template> -->
              <!-- 待确认状态 -->
              <!-- 判断3  确认确认回退能够点击 剩余置灰 -->
              <!-- <template v-else-if="scope.row.feedBackStatus == 1 && scope.row.operationStatus == 0">
              <el-tooltip class="item"
                          effect="light"
                          content="确认"
                          v-has="'M1103018'"
                          placement="bottom-start">
                <span class="option_confirm"
                      @click="confirmRow(scope.row.id)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="回退"
                v-if="scope.row.accountId === false"
                v-has="'M1103019'"
                placement="bottom-start"
              >
                <span
                  class="option_reback"
                  @click="rebackRow(scope.row.id)"
                  style="pointer-evevnts: none"
                ></span>
              </el-tooltip>
              <el-tooltip class="item"
                          effect="light"
                          v-show="!(scope.row.ctag === 'C2' && scope.row.c2Status !== 3)"
                          content="关闭"
                          v-has="'M1103006'"
                          placement="bottom-start">
                <span class="option_close notclick noselect"
                      @click="closeRow(scope.row.id,scope.row.feedBackNumber)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="更新进度"
                v-has="'M1103007'"
                placement="bottom-start"
              >
                <span
                  class="option_update notclick noselect"
                  @click="updateRow(scope.row)"
                ></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="中止"
                v-has="'M1103005'"
                placement="bottom-start"
              >
                <span
                  class="option_suspend notclick noselect"
                  @click="suspendRow(scope.row.id)"
                ></span>
              </el-tooltip>
              <el-dropdown placement="bottom" :hide-timeout="500">
                <span class="option_more notclick noselect"></span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item v-has="'M1103008'"
                    ><span class="hoverMenuItem application"></span
                    ><span @click="application(scope.row)"
                      >申请上会</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103009'">
                    <span class="hoverMenuItem turnTask"></span
                    ><span @click="taskRow(scope.row)">转任务</span>
                  </el-dropdown-item>
                  <el-dropdown-item v-has="'M1103010'"
                    ><span class="hoverMenuItem turnDemand"></span
                    ><span @click="demandRow(scope.row)"
                      >转需求</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103011'"
                    ><span class="hoverMenuItem turnBug"></span
                    ><span @click="bugRow(scope.row)"
                      >转BUG</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103012'" v-if="isDelate"
                    ><span class="hoverMenuItem isDelate"></span
                    ><span>严重超期</span></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103013'"
                    ><span class="hoverMenuItem creatFeed"></span
                    ><span @click="creatFeedRow(scope.row.id)"
                      >绑定反馈</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103014'"
                    ><span class="hoverMenuItem transfer"></span
                    ><span
                      @click="transferRow(scope.row.id, scope.row.productId)"
                      >转让</span
                    ></el-dropdown-item
                  >
                </el-dropdown-menu>
              </el-dropdown>
            </template> -->
              <!-- 已确认状态 -->
              <!-- 判断4 确认回退置灰 其余可点 -->
              <!-- <template v-else-if="scope.row.feedBackStatus == 1 && scope.row.operationStatus == 1">
              <el-tooltip class="item"
                          effect="light"
                          content="确认"
                          v-has="'M1103018'"
                          placement="bottom-start">
                <span class="option_confirm notclick noselect"
                      @click="confirmRow(scope.row.id)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="回退"
                v-has="'M1103019'"
                placement="bottom-start"
              >
                <span
                  class="option_reback notclick noselect"
                  @click="rebackRow(scope.row.id)"
                ></span>
              </el-tooltip>
              <el-tooltip class="item"
                          effect="light"
                          content="关闭"
                          v-show="!(scope.row.ctag === 'C2' && scope.row.c2Status !== 3)"
                          v-has="'M1103006'"
                          placement="bottom-start">
                <span class="option_close"
                      @click="closeRow(scope.row.id,scope.row.feedBackNumber)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="更新进度"
                v-has="'M1103007'"
                placement="bottom-start"
              >
                <span
                  class="option_update"
                  @click="updateRow(scope.row)"
                ></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="中止"
                v-has="'M1103005'"
                placement="bottom-start"
              >
                <span
                  class="option_suspend"
                  @click="suspendRow(scope.row.id)"
                ></span>
              </el-tooltip>
              <el-dropdown placement="bottom" :hide-timeout="500">
                <span class="option_more"></span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item v-has="'M1103008'"
                    ><span class="hoverMenuItem application"></span
                    ><span @click="application(scope.row)"
                      >申请上会</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103009'">
                    <span class="hoverMenuItem turnTask"></span
                    ><span @click="taskRow(scope.row)">转任务</span>
                  </el-dropdown-item>
                  <el-dropdown-item v-has="'M1103010'"
                    ><span class="hoverMenuItem turnDemand"></span
                    ><span @click="demandRow(scope.row)"
                      >转需求</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103011'"
                    ><span class="hoverMenuItem turnBug"></span
                    ><span @click="bugRow(scope.row)"
                      >转BUG</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-if="isDelate" v-has="'M1103012'"
                    ><span class="hoverMenuItem isDelate"></span
                    ><span>严重超期</span></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103013'"
                    ><span class="hoverMenuItem creatFeed"></span
                    ><span @click="creatFeedRow(scope.row.id)"
                      >绑定反馈</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103014'"
                    ><span class="hoverMenuItem transfer"></span
                    ><span
                      @click="transferRow(scope.row.id, scope.row.productId)"
                      >转让</span
                    ></el-dropdown-item
                  >
                </el-dropdown-menu>
              </el-dropdown>
            </template> -->
              <!-- OperationStatus（ OffTheStocks(2)）    feedBackStatus（）   发布成功-->
              <!-- 回退状态 -->
              <!-- <template v-else-if="scope.row.operationStatus === 3"> </template> -->
              <!-- 判断5 中止 更多 -->
              <!-- <template v-else>
              <el-tooltip
                class="item"
                effect="light"
                content="中止"
                v-has="'M1103005'"
                placement="bottom-start"
              >
                <span
                  class="option_suspend"
                  @click="suspendRow(scope.row.id)"
                ></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="激活"
                v-show="
                  scope.row.c1Status === 'C1已关闭' &&
                  scope.row.feedBackStatus === 2 &&
                  scope.row.feedBackStatus === 3
                "
                v-has="'M1103017'"
                placement="bottom-start"
              >
                <span
                  class="option_life"
                  @click="startRow(scope.row.id)"
                ></span>
              </el-tooltip>
              <el-tooltip class="item"
                          effect="light"
                          content="关闭"
                          v-show="!(scope.row.ctag === 'C2' && scope.row.c2Status !== 3)"
                          v-has="'M1103006'"
                          placement="bottom-start">
                <span class="option_close"
                      @click="closeRow(scope.row.id,scope.row.feedBackNumber)"></span>
              </el-tooltip>
              <el-tooltip
                class="item"
                effect="light"
                content="更新进度"
                v-has="'M1103007'"
                placement="bottom-start"
              >
                <span
                  class="option_update"
                  @click="updateRow(scope.row)"
                ></span>
              </el-tooltip>
              <el-dropdown placement="bottom" :hide-timeout="500">
                <span class="option_more"></span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item v-has="'M1103008'"
                    ><span class="hoverMenuItem application"></span
                    ><span @click="application(scope.row)"
                      >申请上会</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103009'">
                    <span class="hoverMenuItem turnTask"></span
                    ><span @click="taskRow(scope.row)">转任务</span>
                  </el-dropdown-item>
                  <el-dropdown-item v-has="'M1103010'"
                    ><span class="hoverMenuItem turnDemand"></span
                    ><span @click="demandRow(scope.row)"
                      >转需求</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103011'"
                    ><span class="hoverMenuItem turnBug"></span
                    ><span @click="bugRow(scope.row)"
                      >转BUG</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103012'" v-if="isDelate"
                    ><span class="hoverMenuItem isDelate"></span
                    ><span>严重超期</span></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103013'"
                    ><span class="hoverMenuItem creatFeed"></span
                    ><span @click="creatFeedRow(scope.row.id)"
                      >绑定反馈</span
                    ></el-dropdown-item
                  >
                  <el-dropdown-item v-has="'M1103014'"
                    ><span class="hoverMenuItem transfer"></span
                    ><span
                      @click="transferRow(scope.row.id, scope.row.productId)"
                      >转让</span
                    ></el-dropdown-item
                  >
                </el-dropdown-menu>
              </el-dropdown>
            </template> -->
            </div>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!-- 控制数据展示数量的分页器 -->
    <!-- <div class="paginationClock">
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="queryinfo.pageIndex"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="queryinfo.pageRow"
        layout="total, sizes, prev, pager, next, jumper"
        :total="totalNumber"
      >
      </el-pagination>
    </div> -->

    <ConfirmDialog ref="ConfirmDialog" :childStageList="childStageList" @refreshPage="onSearchInfo" />
    <SuspendDialog ref="SuspendDialog" @refreshPage="onSearchInfo" />
    <UpdateDialog ref="UpdateDialog" @refreshPage="onSearchInfo" />
    <ApplicationDialog ref="ApplicationDialog" @refreshPage="onSearchInfo" />
    <CloseDialog ref="CloseDialog" @refreshPage="onSearchInfo" />
    <RebackDialog ref="RebackDialog" @refreshPage="onSearchInfo" />
    <RemoveDialog ref="RemoveDialog" @refreshPage="onSearchInfo" />
    <StartDialog ref="StartDialog" @refreshPage="onSearchInfo" />
    <TaskDialog ref="TaskDialog" @refreshPage="onSearchInfo" />
    <CreatFeedDialog ref="CreatFeedDialog" />
    <TransferDialog ref="TransferDialog" @refreshPage="onSearchInfo" />
    <BugRowsDialog ref="BugRowsDialog" @refreshPage="onSearchInfo" />
    <NeedRowDialog ref="NeedRowDialog" />
    <SeriousDelateDialog ref="SeriousDelateDialog" @refreshPage="onSearchInfo" />
  </div>
</template>
<script>
import { taskPandect } from '@/api/tasks/server'
/* 引入通用的状态按钮组件 */
import TaskStatusBtn from '@/components/taskStatusBtn/taskStatusBtn.vue'
import RadioStatusBtn from '@/components/radioStatusBtn/radioStatusBtn.vue'
import BugRowsDialog from '@/components/bugRowsDialog/bugRowsDialog.vue'
import NeedRowDialog from '@/components/needRowDialog/needRowDialog.vue'
// 确认弹出框
import ConfirmDialog from '@/components/confirmDialog/confirmDialog.vue'
// 终止弹出框
import SuspendDialog from '@/components/suspendDialog/suspendDialog.vue'
// 更新进度弹出框
import UpdateDialog from '@/components/updateDialog/updateDialog.vue'
// 申请上会弹出框
import ApplicationDialog from '@/components/applicationDialog/applicationDialog.vue'
// 关闭弹出框
import CloseDialog from '@/components/closeDialog/closeDialog.vue'
// 回退弹出框
import RebackDialog from '@/components/rebackDialog/rebackDialog.vue'
// 删除弹出框
import RemoveDialog from '@/components/removeDialog/removeDialog.vue'
// 激活弹出框
import StartDialog from '@/components/startDialog/startDialog.vue'
// 转任务弹出框
import TaskDialog from '@/components/taskDialog/taskDialog.vue'
// 绑定反馈弹出框
import CreatFeedDialog from '@/components/creatFeedDialog/creatFeedDialog.vue'
// 严重超期弹出框
import SeriousDelateDialog from '@/components/seriousDelateDialog/seriousDelateDialog.vue'
// 转让弹出框
import TransferDialog from '@/components/transferDialog/transferDialog.vue'
/* 引入反馈表单 */
/* 引入转需求表单 */
// import TurnDemandForm from "./components/feedBack/turnDemand";
/* 引入草稿表单 */
// 反馈列表
import { FeedBack } from '@/api/feedBack/server'
import FilterTrans from '@/utils/paramsFiler'
export default {
    name: '',
    components: {
        SeriousDelateDialog,
        RadioStatusBtn,
        TaskStatusBtn,
        ConfirmDialog,
        SuspendDialog,
        UpdateDialog,
        ApplicationDialog,
        CloseDialog,
        RebackDialog,
        RemoveDialog,
        StartDialog,
        TaskDialog,
        CreatFeedDialog,
        TransferDialog,
        BugRowsDialog,
        NeedRowDialog
    },
    props: {
        commonTableData: {
            type: Array
        }
    },
    data() {
        const EFilterOprator = FilterTrans.EFilterOprator
        // const currentDate = this.getDate({
        //   format: true,
        // });
        return {
            // 产品列表
            ProductList: [],
            // 指派人列表
            userList: [],
            // 更新进度指派人列表
            updateUserList: [],
            // 阶段列表
            stageList: [],
            // 解决方案
            FeedBackCloseSet: [],
            // 数据总数
            totalNumber: null,
            // 单行表单数据
            draftForm: {},
            /* 控制解决方案 是否可点 */
            isSolutionCase: true,
            // 在这里假定严重超期状态标识
            isDelate: true,
            tableItemsId: '',
            productsID: '',
            // 控制删除弹出框
            deleteDialogVisible: false,
            // 控制新建弹出框的显示和隐藏
            insertDialogVisible: false,
            // 控制回退弹出框的显示和隐藏
            rebackDialogVisible: false,
            // 控制关闭弹出框的显示和隐藏
            closeDialogVisible: false,
            // 控制转需求弹出框的显示和隐藏
            demandDialogVisible: false,
            // 控制转任务弹出框的显示和隐藏
            taskDialogVisible: false,
            // 控制绑定反馈弹出框的显示和隐藏
            creatFeedDialogVisible: false,
            // 控制激活弹出框的显示与隐藏
            startDialogVisible: false,
            // 控制更新进度弹出框的显示和隐藏
            updateDialogVisible: false,
            // 控制申请上报弹出框的显示和隐藏
            applicationDialogVisible: false,
            // 控制发布/编辑弹出框的显示和隐藏
            submitDialogVisible: false,
            // 控制申请上会的显示和隐藏
            // applicationDialogVisible: false,
            // 控制转让弹出框的显示和隐藏
            transferDialogVisible: false,
            // 控制评论弹出框的显示和隐藏
            commentsDialogVisible: false,
            // 控制严重超期反馈弹出框的显示和隐藏
            seriousDelateVisible: false,
            // 回退弹出框表单内容
            rebackForm: {
                rebackReason: ''
            },
            // 关闭弹出框表单内容
            closeForm: {
                closeReason: '',
                closeSolution: '',
                extra: ''
            },

            // 转需求表单
            turnDemandForm: {},
            closeFormRules: {
                closeReason: [{ required: true, message: '请选择关闭原因', trigger: 'change' }],
                closeSolution: [{ required: true, message: '请输入解决方案', trigger: 'change' }],
                extra: [{ required: false, message: '请输入备注', trigger: 'change' }]
            },
            creatFeedForm: {
                feedBackId: '',
                feedBackReason: ''
            },
            creatFeedFormRules: {
                feedBackId: [{ required: true, message: '请输入反馈ID', trigger: 'change' }],
                feedBackReason: [{ required: true, message: '请输入备注', trigger: 'change' }]
            },
            transferForm: {
                feedBackId: '',
                feedBackReason: ''
            },
            commentsForm: {
                feedBackReason: ''
            },
            taskForm: {
                creater: '',
                productId: '',
                theirProducts: '',
                taskStatus: '',
                TheirProducts: '',
                taskIdentity: '',
                // closingDate: currentDate,
                currentResponsiblePerson: '',
                department: '',
                trackItems: ''
            },
            createTaskForm: {
                productId: '',
                productName: '',
                taskStatus: 0,
                TheirProducts: '',
                taskIdentity: 1,
                closingDate: '',
                currentResponsiblePerson: '',
                department: '',
                trackItems: ''
            },
            createTaskFormrules: {
                productId: [{ required: false, message: '请输入任务ID', trigger: 'change' }],
                productName: [{ required: false, message: '请输入关联反馈ID', trigger: 'blur' }],
                taskStatus: [{ required: true, message: '请选择任务状态', trigger: 'change' }],
                TheirProducts: [{ required: false, message: '请输入关联反馈ID', trigger: 'blur' }],
                taskIdentity: [{ required: true, message: '请选择任务标识', trigger: 'change' }],
                closingDate: [{ required: true, message: '请选择截止日期', trigger: 'change' }],
                currentResponsiblePerson: [{ required: true, message: '请选择当前责任人', trigger: 'change' }],
                department: [{ required: false, message: '请选择责任人部门', trigger: 'blur' }],
                trackItems: [{ required: true, message: '请输入跟踪事项', trigger: 'change' }]
            },
            taskFormrules: {
                productId: [{ required: true, message: '请输入反馈ID', trigger: 'change' }],
                creater: [{ required: true, message: ' ', trigger: 'change' }],
                closingDate: [
                    {
                        type: 'date',
                        required: true,
                        message: '请选择日期',
                        trigger: 'change'
                    }
                ],
                theirProducts: [{ required: true, message: ' ', trigger: 'change' }],
                taskStatus: [{ required: true, message: ' ', trigger: 'change' }],
                TheirProducts: [{ required: true, message: ' ', trigger: 'change' }],
                taskIdentity: [{ required: true, message: ' ', trigger: 'change' }],
                currentResponsiblePerson: [{ required: true, message: ' ', trigger: 'change' }],
                department: [{ required: true, message: ' ', trigger: 'change' }]
            },
            /* 是否关联BUG/需求 */
            linkType: [
                {
                    value: 1,
                    title: 'Bug'
                },
                {
                    value: 2,
                    title: '需求'
                },
                {
                    value: 3,
                    title: 'Bug/需求'
                },
                {
                    value: 0,
                    title: '反馈'
                }
            ],
            theirProductsList: [
                {
                    label: '产品1',
                    value: 0
                },
                {
                    label: '产品2',
                    value: 5
                }
            ],
            taskStatusList: [
                {
                    label: '新建',
                    value: 0
                },
                {
                    label: '处理中',
                    value: 5
                },
                {
                    label: '已关闭',
                    value: 10
                }
            ],
            taskIdentityList: [
                {
                    label: 'C1',
                    value: 0
                },
                {
                    label: 'C2',
                    value: 5
                }
            ],
            taskIdentityListC: [
                {
                    label: 'C1',
                    value: 0
                },
                {
                    label: 'C2',
                    value: 1
                }
            ],
            currentResponsiblePersonList: [
                {
                    label: '姓名1',
                    value: 0
                },
                {
                    label: '姓名2',
                    value: 5
                }
            ],
            // 激活弹出框表单内容
            startForm: {
                startReason: ''
            },
            // 更新进度
            updateForm: {
                nowStage: '',
                carbonPerson: '',
                nowPlaint: '',
                department: ''
            },
            // 申请上报弹出框表单内容
            applicationForm: {
                feedId: '',
                createPerson: '',
                mettingTime: '',
                isWill: '',
                mainPrincipal: '',
                otherPriCipal: '',
                willReason: ''
            },

            // 超期标识
            StageOverdueTagEnum: [
                {
                    value: false,
                    title: '未超期'
                },
                {
                    value: true,
                    title: '超期'
                }
            ],

            // 申请弹出框
            applicationFormRules: {},
            // C1/C2标识
            ctag: [
                {
                    title: 'C1',
                    value: 0
                },
                {
                    title: 'C2',
                    value: 1
                },
                {
                    title: 'C1/C2',
                    value: 2
                }
            ],
            // 筛选条件
            SelectConditionForm: {
                ctag: '',
                productId: '',
                influenceCategory: '',
                stageId: '',
                assignedUserId: '',
                feedBackNumber: '',
                dateTime: '',
                startTime: '',
                endTime: ''
            },
            searchCondition: [
                {
                    field: 'ctag',
                    operator: EFilterOprator.Equal
                },
                {
                    field: 'productId',
                    operator: EFilterOprator.Equal
                },
                {
                    field: 'influenceCategory',
                    operator: EFilterOprator.Equal
                },
                {
                    field: 'stageId',
                    operator: EFilterOprator.Equal
                },
                {
                    field: 'assignedUserId',
                    operator: EFilterOprator.Equal
                },
                {
                    field: 'feedBackNumber',
                    operator: EFilterOprator.Equal
                }
            ],
            /* 下拉框选项 */
            selectInput: {
                productsID: '',
                marketsID: ''
            },
            userDOlist: [],
            marketingStatusList: [],
            queryinfo: {
                pageIndex: 1,
                pageRow: 50
            },
            feedBackList: [],
            // 控制表格的列根据选择动态渲染
            // 控制表格的列根据选择动态渲染
            colData: [
                { title: '超期标识', istrue: true },
                { title: 'C1/C2标识', istrue: true },
                { title: '反馈类型', istrue: true },
                { title: '反馈ID', istrue: true },
                { title: '产品名称', istrue: true },
                { title: '标题', istrue: true },
                { title: '影响类别', istrue: true },
                { title: 'C1状态', istrue: true },
                { title: 'C2状态', istrue: true },
                { title: '阶段超期标识', istrue: true },
                { title: '所处阶段', istrue: true },
                { title: '指派给', istrue: true },
                { title: '最后更新时间', istrue: true },
                { title: '创建人', istrue: true },
                { title: '创建部门', istrue: true },
                { title: '是否服务请求', istrue: true },
                { title: '营销项目名称', istrue: true },
                { title: '营销项目状态', istrue: true },
                { title: '版本号', istrue: true },
                { title: '反馈来源', istrue: true },
                { title: '问题类别', istrue: true }
            ],
            colOptions: [],
            colSelect: [],
            // 验证规则
            SelectConditionFormrules: {
                dateTime: [
                    {
                        type: 'date',
                        required: true,
                        message: '请选择时间',
                        trigger: 'change'
                    }
                ],
                ctag: [{ required: true, message: '请选择状态标识', trigger: 'change' }],
                productId: [{ required: true, message: '请选择所属产品', trigger: 'change' }],
                influenceCategory: [{ required: true, message: '请选择影响类别', trigger: 'change' }],
                stageId: [{ required: true, message: '请选择处理阶段', trigger: 'change' }],
                assignedUserId: [{ required: true, message: '请选择指派人', trigger: 'change' }]
            },
            //  C1状态按钮
            C1status: [
                {
                    label: '处理中',
                    value: 'BeingProcessed'
                },
                {
                    lael: '已关闭',
                    value: 'Closed'
                }
            ],
            childStageList: [],
            //  C2状态按钮
            C2status: [
                {
                    label: '处理中',
                    value: 0
                },
                {
                    label: '已关闭',
                    value: 1
                },
                {
                    label: '待明确',
                    value: 2
                },
                {
                    label: '未开始',
                    value: 3
                },
                {
                    label: '',
                    value: 4
                }
            ],
            // 状态按钮
            flowStatusList: [
                {
                    label: '已关闭',
                    value: 0
                },
                {
                    label: '处理中',
                    value: 5
                },
                {
                    label: '已完成',
                    value: 10
                },
                {
                    label: '已中止',
                    value: 15
                },
                {
                    label: '已过期',
                    value: 20
                }
            ],
            dynamicValidateForm: [],
            // 优先级
            priorityList: [
                {
                    label: '1级',
                    value: 1
                },
                {
                    label: '2级',
                    value: 2
                },
                {
                    label: '3级',
                    value: 3
                },
                {
                    label: '4级',
                    value: 4
                }
            ],
            isAssigned: false,
            // 表格影响类别列表
            influenceCategoryT: [
                {
                    title: '影响现场生产',
                    value: 'AffectSiteProduction'
                },
                {
                    title: '影响验收',
                    value: 'InfluenceAcceptance'
                },
                {
                    title: '影响回款',
                    value: 'AffectTheReceivable'
                },
                {
                    title: '影响不大',
                    value: 'NoInfluence'
                }
            ],
            // 影响类别列表
            influenceCategory: [
                {
                    title: '影响现场生产',
                    value: 0
                },
                {
                    title: '影响验收',
                    value: 1
                },
                {
                    title: '影响回款',
                    value: 2
                },
                {
                    title: '影响不大',
                    value: 3
                }
            ],

            // 用户信息
            userInfo: {},
            accountInformation: '',
            selectIndex: '',
            insertUserList: [],
            // 影响处理阶段列表
            Stage: [
                {
                    title: '待确认',
                    value: 'ToBeConfirmed'
                },
                {
                    title: '已确认',
                    value: 'Acknowledged'
                }
            ],
            /* V2新增的更新进度/评论 */
            isUpdateTarget: '',
            /* 反馈关闭原因列表 */
            closeFeedBackReasonList: [],

            /* 产品ID */
            productID: '',
            /* 反馈ID */
            feedBackId: '',
            //  是否服务请求
            serverRequestTagEnum: [
                {
                    value: false,
                    title: '否'
                },
                {
                    value: true,
                    title: '是'
                }
            ]
        }
    },
    computed: {},
    created() {
    //  创建表格显示项
        var _this = this
        for (let i = 0; i < _this.colData.length; i++) {
            _this.colSelect.push(_this.colData[i].title)
            // if (_this.colData[i].title == "所属产品") {
            //   //初始化不想展示的列可以放在这个条件里
            //   continue;
            // }
            _this.colOptions.push(_this.colData[i].title)
        }
    },
    watch: {
    //  监听表格显示项
        colOptions(valArr) {
            var arr = this.colSelect.filter(i => valArr.indexOf(i) < 0) // 未选中
            this.colData.filter(i => {
                if (arr.indexOf(i.title) != -1) {
                    i.istrue = false
                } else {
                    i.istrue = true
                }
            })
            this.$nextTick(() => {
                this.$refs.tableDataRef.doLayout()
            })
            // 将用户的配置习惯保存在本地
            localStorage.setItem('settingListSF', JSON.stringify(this.colOptions))
            // this.SaveFieldAsync(this.colOptions)
        }
    },
    mounted() {
        const settingArr = JSON.parse(localStorage.getItem('settingListSF'))
        if (settingArr != null) {
            this.colOptions = settingArr
        }
        this.onSearchInfo()
        // this.getProductList()
        // this.getUserList()
        // this.getStageList()
        // this.getChildStageList()
        // this.getCloseFeedBackReasonList()
    // this.getuserId()
    // 获得当前用户信息
    },
    // 过滤器 用来过滤文字信息
    filters: {
    /**
     * @description:文字过滤器
     * @param {String} _val 传入的值
     * @param {Array} _list 定义的转换数组
     */
        transferSeverity(_val, _list) {
            let str = ''
            _list.findIndex(_item => {
                if (_item.value === _val) {
                    str = _item.title
                    return true
                } else {
                    return false
                }
            })
            return str
        },
        /**
     * @description:时间过滤器
     * @param {Date} _val
     * @return {String} str 转换格式后的字符串
     */
        dateTime(_val) {
            let str = ''
            str = this.dayjs(_val).format('YYYY-MM-DD HH:mm:ss')
            return str
        },
        /**
     * @description:字符串长度过滤器
     * @param {String} _val
     * @return {String} 字符串切割后的字符串
     */
        formatData(_val) {
            if (_val) {
                return _val.substring(0, 10)
            }
            return ''
        },
        formatTimer: function(value) {
            console.log(value)
            if (value) {
                const date = new Date(value)
                const y = date.getFullYear()
                let MM = date.getMonth() + 1
                MM = MM < 10 ? '0' + MM : MM
                let d = date.getDate()
                d = d < 10 ? '0' + d : d
                let h = date.getHours()
                h = h < 10 ? '0' + h : h
                let m = date.getMinutes()
                m = m < 10 ? '0' + m : m
                let s = date.getSeconds()
                s = s < 10 ? '0' + s : s
                return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s
            } else {
                return value
            }
        }
    },
    methods: {
    /**
     * @description: 绑定反馈判断
     * @param {String} event 绑定反馈的主键
     */
        async onClickblur(event) {
            const arr = {
                id: this.tableItemsId,
                linkFeedBackNumber: event
            }
            try {
                const result = await FeedBack.FeedBackBindingJudgeAsync(arr)
                if (result.success) {
                    this.$message.success(result.message)
                } else {
                    this.$message.error(result.message)
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description:获取当前用户信息
     */
        async getuserId() {
            try {
                const result = await FeedBack.UserGetUserInfoAsync()
                if (result.success) {
                    console.log('获取当前账号信息', result.data)
                    this.accountInformation = result.data
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description:保存字段配置
     * @param {Array[String]} _val
     */
        async SaveFieldAsync(_val) {
            // 根据产品ID获得指派人列表
            try {
                const result = await FeedBack.SaveFieldAsync(_val)
                if (result.success) {
                    console.log('Success')
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description:加载用户自定义配置字段
     */
        async GetLoadFiledAsync() {
            // 根据产品ID获得指派人列表
            try {
                const result = await FeedBack.GetLoadFiledAsync()
                if (result.success) {
                    this.colOptions = result.data
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description:接收的人员信息列表
     * @param {String} _val 产品ID
     */
        async productionChange(_val) {
            // 根据产品ID获得指派人列表
            try {
                const result = await FeedBack.GetListItemAsync({ id: _val })
                if (result.success) {
                    // 过滤当前责任人
                    const arr = JSON.parse(JSON.stringify(result.data))
                    let index = ''
                    for (var i = 0; i < arr.length; i++) {
                        const item = arr[i]
                        if (item.id === this.userInfo.id) {
                            index = i
                        }
                    }
                    arr.splice(index, 1)
                    this.userDOlist = arr
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description:获取反馈关闭原因
     */
        async getCloseFeedBackReasonList() {
            try {
                const result = await FeedBack.FormOptionGetListItemAsync({
                    type: 'FeedBackCloseSet'
                })
                if (result.success) {
                    this.closeFeedBackReasonList = result.data
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description:获得营销项目状态列表
     * @param {String} _val 营销项目名称ID
     */
        async marketProjectChange(_val) {
            try {
                const result = await FeedBack.FormOptionGetListItemAsync({
                    id: _val,
                    type: 'MarketingProject'
                })
                if (result.success) {
                    this.marketingStatusList = result.data
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description: 获取所有产品信息
     */
        async getProductList() {
            try {
                const result = await FeedBack.ProInsertAsync()
                if (result.success) {
                    this.ProductList = result.data
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description: 处理时间格式
     * @param {Date} type 时间对象
     * @return {String}  规则拼接的字符串
     */
        getDate(type) {
            const date = new Date()
            let year = date.getFullYear()
            let month = date.getMonth() + 1
            let day = date.getDate()
            if (type === 'start') {
                year = year - 60
            } else if (type === 'end') {
                year = year + 2
            }
            month = month > 9 ? month : '0' + month
            day = day > 9 ? day : '0' + day
            return `${year}-${month}-${day}`
        },

        /**
     * @description:获取指派人列表
     */
        async getUserList() {
            try {
                const result = await FeedBack.GetAllUserAsync()
                if (result.success) {
                    this.userList = result.data
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description:获取阶段列表
     */
        async getStageList() {
            try {
                const result = await FeedBack.GetStageListAsync({ type: 'Name' })
                if (result.success) {
                    this.stageList = result.data
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description:页面加载函数
     */
        onSearch() {
            this.filter = FilterTrans.buildPageRequest(this.SelectConditionForm, this.searchCondition)
            this.getFeedBackList()
        },

        /**
     * @description:导出表格
     */
        exportCharts() {
            this.tasklist = []
            this.filter = FilterTrans.buildPageRequest(this.SelectConditionForm, this.searchCondition)
            this.fileDownload()
        },

        /**
     * @description:监听 关闭弹出框
     */
        CloeseDialog() {
            this.FeedBackCloseSet = []
        },

        /**
     * @description:时间处理函数
     * @param {*} data
     * @return {*}
     */
        getTime(data) {
            const value =
        data.getFullYear() +
        '-' +
        this.checkTime(data.getMonth() + 1) +
        '-' +
        this.checkTime(data.getDate()) +
        ' ' +
        this.checkTime(data.getHours()) +
        ':' +
        this.checkTime(data.getMinutes()) +
        ':' +
        this.checkTime(data.getSeconds())
            return value
        },

        /**
     * @description:显示转换
     * @param {Nummber} i
     * @return {Number} 转换后的数字
     */
        checkTime(i) {
            if (i < 10) {
                i = '0' + i
            }
            return i
        },

        /**
     * @description:构建filter实例对象
     * @param {Object} _filter
     * @return {Object} 构建后的filter对象
     */
        handleForm(_filter) {
            const filters = FilterTrans.filterParam(_filter.queryFilter.filters)
            const filter = JSON.parse(JSON.stringify(_filter))
            filter.queryFilter.filters = filters

            filter.pageIndex = this.queryinfo.pageIndex
            filter.pageRow = this.queryinfo.pageRow
            const time = this.SelectConditionForm.dateTime

            if (time.length) {
                const startTime = this.getTime(time[0])
                const endtTime = this.getTime(time[1])
                filters.push({
                    field: 'createTime',
                    operator: 2,
                    value: startTime
                })
                filters.push({
                    field: 'createTime',
                    operator: 4,
                    value: endtTime
                })
            }

            return filter
        },

        /**
     * @description:异步下载方法
     */
        async fileDownload() {
            try {
                const data = this.handleForm(this.filter)
                await FeedBack.ExportAsync(data, '数据统计')
            } catch (err) {
                this.$message.error('服务器异常')
            }
        },

        /**
     * @description：跳转创建反馈
     */
        toinsert() {
            this.$router.push('/createFeedBack')
        },

        /**
     * 确认转任务
     */
        /**
     * @description:确认传任务
     * @param {String} formName 转任务的from表单绑定的ref
     */
        async taskCancel(formName) {
            this.$refs[formName].validate(async valid => {
                if (valid) {
                    const objparams = {
                        ctag: this.createTaskForm.taskIdentity,
                        expectedCompletedDate: this.createTaskForm.closingDate,
                        feedBackId: this.createTaskForm.TheirProducts,
                        responsibleUser: this.createTaskForm.currentResponsiblePerson,
                        status: this.createTaskForm.taskStatus,
                        trackingTip: this.createTaskForm.trackItems
                    }
                    console.log(objparams)
                    try {
                        const result = await taskPandect.FeedBackTurnToTheTask(objparams)
                        if (result.success) {
                            this.createTaskForm = {
                                productId: '',
                                productName: '',
                                taskStatus: '',
                                TheirProducts: '',
                                taskIdentity: '',
                                closingDate: '',
                                currentResponsiblePerson: '',
                                department: '',
                                trackItems: ''
                            }
                            this.taskDialogVisible = false
                            this.onSearchInfo()
                            this.$refs[formName].resetFields()
                        }
                    } catch (err) {
                        console.log(err)
                    }
                } else {
                    return false
                }
            })
        },

        /**
     * @description: 确认转任务
     */
        deleteConfirm() {
            this.DeleteAsync({ id: this.tableItemsId })
        },

        /**
     * @description: 确认关闭
     * @param {String} formName 关闭的form表单绑定的ref
     */
        confirmClose(formName) {
            let val = ''
            for (const item of this.closeFeedBackReasonList) {
                if (item.id === this.closeForm.closeReason) {
                    val = item.val
                }
            }
            const objParmars = {
                closeTheReason: this.closeForm.closeReason,
                content: this.closeForm.closeSolution,
                id: this.tableItemsId,
                operationType: 'Close',
                remark: this.closeForm.extra
            }
            this.$refs[formName].validate(valid => {
                if (valid) {
                    this.CloseOptionAsync(objParmars, val)
                    this.$refs[formName].resetFields()
                } else {
                    this.$message.error('请检查表单信息是否填写完整')
                    return false
                }
            })
        },

        /**
     * @description: 确认激活
     */
        confirmStart() {
            const objParmars = {
                content: this.startForm.startReason,
                id: this.tableItemsId,
                operationType: 'Activate'
            }
            this.$refs['startFormRef'].validate(valid => {
                if (valid) {
                    this.startOptionAsync(objParmars)
                    this.startDialogVisible = false
                } else {
                    this.$message.error('请检查表单信息是否填写完整')
                    return false
                }
            })
        },

        /**
     * @description: 确认绑定反馈
     * @param {String} formName 绑定反馈的form表单绑定的ref
     * @return {*}
     */
        confirmbinding(formName) {
            const objParams = {
                id: this.tableItemsId,
                linkFeedBackNumber: this.creatFeedForm.feedBackId,
                operation: 0,
                reason: this.creatFeedForm.feedBackReason
            }
            this.$refs[formName].validate(valid => {
                if (valid) {
                    this.binding(objParams)
                    this.$refs[formName].resetFields()
                } else {
                    this.$message.error('请检查表单信息是否填写完整')
                    return false
                }
            })
        },

        /**
     * @description: 确认转让
     */
        confirmtransfer() {
            const objParams = {
                content: this.transferForm.feedBackReason,
                id: this.tableItemsId,
                operationType: 'MakeOver',
                userId: this.transferForm.feedBackId
            }
            this.$refs['transferFormRef'].validate(valid => {
                if (valid) {
                    this.transfer(objParams)
                    this.transferDialogVisible = false
                } else {
                    this.$message.error('请检查表单信息是否填写完整')
                    return false
                }
            })
        },

        /**
     * @description: 确认评论
     */
        confirmcomments() {
            const objParmars = {
                content: this.commentsForm.feedBackReason,
                id: this.tableItemsId,
                operationType: 'Comment'
            }
            this.$refs['commentsFormRef'].validate(valid => {
                if (valid) {
                    this.comment(objParmars)
                    this.commentsDialogVisible = false
                } else {
                    this.$message.error('请检查表单信息是否填写完整')
                    return false
                }
            })
        },

        /**
     * @description: 确认回退
     */
        cofirmReback() {
            const objParams = {
                content: this.rebackForm.rebackReason,
                id: this.tableItemsId,
                operationType: 'Rollback'
            }
            this.reBack(objParams)
        },

        /**
     * @description: 编辑反馈
     * @param {String} _id 主键ID
     */
        async submitForm(_id) {
            this.$router.push({ path: 'editFeedBack?editId=' + _id })
        },

        tosubmit() {
            this.submitDialogVisible = true
        },

        canselsubmit() {
            this.submitDialogVisible = false
        },

        canselapplication() {
            this.applicationDialogVisible = false
        },

        suspendCancel() {
            this.suspendDialogVisible = false
        },

        rebackCancel() {
            this.rebackDialogVisible = false
        },

        closeCancel() {
            this.closeDialogVisible = false
        },

        creatFeedCancel() {
            this.creatFeedDialogVisible = false
        },

        transferCancel() {
            this.transferDialogVisible = false
        },

        commentsCancel() {
            this.commentsDialogVisible = false
        },

        demandCancel() {
            this.demandDialogVisible = false
        },

        startCancel() {
            this.startDialogVisible = false
        },

        deleteCancel() {
            this.deleteDialogVisible = false
        },

        applicationCancel() {
            this.applicationDialogVisible = false
        },

        // 从子组件传递过来的状态更新
        submitChange(val) {
            this.submitDialogVisible = val
        },

        suspendChange(val) {
            this.suspendDialogVisible = val
            this.$refs['suspendForm'].resetFields()
        },

        rebackChange(val) {
            this.rebackDialogVisible = val
        },

        closeChange(val) {
            this.closeDialogVisible = val
            this.$refs['closeForm'].resetFields()
        },

        creatFeedChange(val) {
            this.creatFeedDialogVisible = val
            this.$refs['creatFeedForm'].resetFields()
        },

        transferChange(val) {
            this.transferDialogVisible = val
        },

        commentsChange(val) {
            this.commentsDialogVisible = val
        },

        demandChange(val) {
            this.demandDialogVisible = val
        },

        taskChange(val) {
            this.taskDialogVisible = val
        },

        startChange(val) {
            this.startDialogVisible = val
        },

        deleteChange(val) {
            this.deleteDialogVisible = val
        },

        applicationChange(val) {
            this.applicationDialogVisible = val
        },

        handleSizeChange(_val) {
            this.queryinfo.pageRow = _val
            this.onSearchInfo()
        },

        handleCurrentChange(_val) {
            console.log(_val)
            this.queryinfo.pageIndex = _val
            this.onSearchInfo()
        },

        /**
     * @description: 重置页面筛选条件
     */
        reset() {
            this.$refs['SelectConditionForm'].resetFields()
            this.onSearchInfo()
        },

        /**
     * @description:中止方法
     * @param {String} 主键ID
     */
        suspendRow(id) {
            this.$refs.SuspendDialog.show(id)
        },

        /**
     * @description: 回退方法
     * @param {String} id 主键ID
     */
        rebackRow(id) {
            this.$refs.RebackDialog.show(id)
        },
        bugRows(number) {
            this.$refs.BugRowsDialog.show(number)
        },
        needRow(number) {
            this.$refs.NeedRowDialog.show(number)
        },

        /**
     * @description: 关闭方法
     * @param {String} id 主键ID
     */
        closeRow(id) {
            for (var i = 0; i < this.feedBackList.length; i++) {
                const item = this.feedBackList[i]
                if (item.id === id) {
                    this.selectIndex = i
                }
            }
            this.$refs.CloseDialog.show(id, 'feedBack')
        },

        /**
     * @description: 转需求方法
     * @param {Object} row 当前操作行对象
     */
        demandRow(row) {
            this.feedBackId = row.feedBackId
            this.productID = row.productId
            this.$router.push({
                path: 'turnDemand?productId=' + row.productId + '&feedbackId=' + row.id
            })
        },

        /**
     * @description: 转任务方法
     * @param {Object} data 当前操作行对象
     * @return {*}
     */
        taskRow(data) {
            // console.log(data)
            // const row = JSON.stringify(data)
            // this.$refs.TaskDialog.show(row)
            this.$refs.TaskDialog.show(data.feedBackNumber, data.id)
        },

        /**
     * @description: 查询产品名称
     * @param {String} _id 反馈ID
     */
        async getProductId(_id) {
            const feedBackId = _id
            try {
                const result = await taskPandect.GetProductIdByFeedId(feedBackId)
                if (result.success) {
                    this.createTaskForm.productName = result.data.name
                    const prouctId = result.data.id
                    // 根据当前产品ID查询责任人
                    this.insertUserList = []
                    try {
                        const res = await FeedBack.GetListItemAsync({ id: prouctId })
                        if (res.success) {
                            this.insertUserList = res.data
                        }
                    } catch (err) {
                        console.log(err)
                    }
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description: 查询所在部门
     * @param {String} _val 人员ID
     */
        getPersonDepartment(_val) {
            this.createTaskForm.department = ''
            this.insertUserList.forEach(item => {
                if (item.id == _val) {
                    this.createTaskForm.department = item.department
                }
            })
        },

        /**
     * @description: 删除方法
     * @param {String} id 主键ID
     */
        deleteRow(id) {
            console.log(id)
            this.$refs.RemoveDialog.show(id)
        },

        /**
     * @description: 确认方法
     * @param {String} id 主键ID
     */
        confirmRow(id) {
            this.$refs.ConfirmDialog.show(id)
        },

        /**
     * @description: 绑定反馈方法
     * @param {String} id 主键ID
     */
        creatFeedRow(id) {
            this.$refs.CreatFeedDialog.show(id)
        },

        /**
     * @description: 转让方法
     * @param {Sting} id 主键ID
     * @param {Sting} productId 产品ID
     */
        transferRow(id, productId) {
            this.$refs.TransferDialog.show(id, productId)
        },

        /**
     * @description: 更新进度方法
     * @param {Object} row 当前操作行对象
     */
        updateRow(row) {
            const string = JSON.stringify(row)
            const stageId = row.stageId
            const trueID = row.id
            this.$refs.UpdateDialog.show(string, stageId, trueID)
        },

        /**
     * @description: 申请上会方法
     * @param {Object} row 当前操作行对象
     */
        application(row) {
            const str = JSON.stringify(row)
            this.$refs.ApplicationDialog.show(str)
        },

        /**
     * @description: 激活方法
     * @param {String} id 主键ID
     */
        startRow(id) {
            this.$refs.StartDialog.show(id)
        },

        /**
     * @description: 删除方法
     * @param {String} id 主键ID
     */
        async DeleteAsync(id) {
            try {
                const result = await FeedBack.DeleteAsync(id)
                if (result.success) {
                    this.deleteDialogVisible = false
                    this.tableItemsId = ''
                    this.onSearchInfo()
                }
            } catch (error) {
                console.log(error)
            }
        },

        /**
     * @description: 关闭方法
     * @param {Object} parmars 关闭操作需要传递的对象
     * @param {Boolean} val 是否开启C2的状态值
     */
        async CloseOptionAsync(parmars, val) {
            try {
                const result = await FeedBack.OperationAsync(parmars)
                if (result.success) {
                    this.closeDialogVisible = false
                    this.closeForm = {
                        closeReason: '',
                        closeSolution: '',
                        extra: ''
                    }
                    this.onSearchInfo()
                    if (val === 'true') {
                        console.log(this.feedBackList, this.tableItemsId)
                        for (const item of this.feedBackList) {
                            if (item.id === this.tableItemsId) {
                                this.taskRow(item)
                                return item
                            }
                        }
                    }
                }
            } catch (error) {
                console.log(error)
            }
        },

        /**
     * @description: 激活方法
     * @param {Object} parmars 激活方法需要传入的对象
     */
        async startOptionAsync(parmars) {
            try {
                const result = await FeedBack.OperationAsync(parmars)
                if (result.success) {
                    this.closeDialogVisible = false
                    this.startForm = {
                        startReason: ''
                    }
                    this.onSearchInfo()
                }
            } catch (error) {
                console.log(error)
            }
        },

        /**
     * @description: 绑定反馈方法
     * @param {Object} params 绑定反馈需要传入的对象
     */
        async binding(params) {
            try {
                const result = await FeedBack.LinkFeedBackOperationAsync(params)
                if (result.success) {
                    this.creatFeedDialogVisible = false
                    this.creatFeedForm = {
                        feedBackId: '',
                        feedBackReason: ''
                    }
                    this.onSearchInfo()
                }
            } catch (error) {
                console.log(error)
            }
        },

        /**
     * @description: 转让方法
     * @param {Object} params 转让方法需要传入的对象
     */
        async transfer(params) {
            try {
                const result = await FeedBack.OperationAsync(params)
                if (result.success) {
                    this.transferDialogVisible = false
                    this.transferForm = {
                        feedBackId: '',
                        feedBackReason: ''
                    }
                    this.onSearchInfo()
                }
            } catch (error) {
                console.log(error)
            }
        },

        /**
     * @description: 评论方法
     * @param {Object} params 评论方法需要传入的对象
     */
        async comment(params) {
            try {
                const result = await FeedBack.OperationAsync(params)
                if (result.success) {
                    this.commentsDialogVisible = false
                    this.commentsForm = {
                        feedBackReason: ''
                    }
                    this.onSearchInfo()
                }
            } catch (error) {
                console.log(error)
            }
        },

        /**
     * @description: 回退方法
     * @param {Object} params 回退方法需要传入的对象
     */
        async reBack(params) {
            try {
                const result = await FeedBack.OperationAsync(params)
                if (result.success) {
                    this.rebackDialogVisible = false
                    this.rebackForm = {
                        rebackReason: ''
                    }
                    this.onSearchInfo()
                } else {
                    this.$message.warning(result.message)
                }
            } catch (error) {
                console.log(error)
            }
        },

        /**
     * @description: 确认方法
     * @param {Object} params 确认方法需要传入的对象
     */
        async confirmOptionAsync(parmars) {
            try {
                const result = await FeedBack.OperationAsync(parmars)
                if (result.success) {
                    this.onSearchInfo()
                    this.$message.success('已确认')
                }
            } catch (error) {
                console.log(error)
            }
        },

        /**
     * @description: 获取反馈列表数据
     */
        async getFeedBackList() {
            try {
                const data = this.handleForm(this.filter)
                const result = await FeedBack.GetPageAsync(data)
                if (result.success) {
                    for (const item of result.data.data) {
                        const ctagL = item.ctag
                        if (ctagL != null) {
                            if (ctagL.indexOf('And') > -1) {
                                console.log('22222')
                                const start = ctagL.slice(0, 2)
                                const end = ctagL.slice(5, 7)
                                item.ctag = start + '/' + end
                            }
                        }

                        if (item.creatorId === this.accountInformation.id) {
                            item.accountId = true
                        } else {
                            item.accountId = false
                        }
                    }
                    this.feedBackList = result.data.data
                    this.totalNumber = result.data.total
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description: 清空表单
     */
        clearForm() {
            this.FeedBackCloseSet = []
            this.isSolutionCase = true
        },

        /**
     * @description: 转BUG 跳转
     * @param {Object} row 操作当前行的对象
     */
        bugRow(row) {
            this.$router.push({
                path: 'turnBug?productId=' + row.productId + '&feedbackId=' + row.id
            })
        },

        /**
     * @description: 反馈详情 跳转
     * @param {Object} row 操作当前行的对象
     */
        tofeedBack(row) {
            const toDeatailPageStatus = row.feedBackStatus
            const id = row.id
            const buttonStatus = row.operationStatus
            const stageId = row.stageId
            if (toDeatailPageStatus == 0) {
                return false
            } else {
                this.$router.push({
                    path: 'Details?id=' + id + '&buttonStatus=' + buttonStatus + '&stageId=' + stageId
                })
            }
        },
        tofeedBackWithoutBtn(row) {
            this.$router.push({
                path: 'Details?id=' + row.feedBackId
            })
        },
        /**
     * @description: 确认上会
     */
        async confirmApplication() {
            const objparams = {
                continueMeeting: this.applicationForm.isWill,
                feedBackNumber: this.applicationForm.feedId,
                otherPrincipalUserName: this.applicationForm.otherPriCipal,
                reason: this.applicationForm.willReason,
                thisWeek: this.applicationForm.mettingTime
            }
            try {
                const result = await FeedBack.ApplyMeeting(objparams)

                if (result.success) {
                    this.applicationDialogVisible = false
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description: 获取阶段信息
     */
        async getChildStageList() {
            try {
                const result = await FeedBack.GetListChildrenAsync({ type: 'NAME' })
                if (result.success) {
                    for (var i = 0; i < result.data.length; i++) {
                        const item = result.data[i]
                        if (
                            item.id != '1423154037607493634' &&
              item.id != '1423154076169924610' &&
              item.id != '1423154128091213825'
                        ) {
                            this.childStageList.push(item)
                        }
                    }
                }
            } catch (err) {
                console.log(err)
            }
        },

        /**
     * @description: 获取相关下拉列表
     * @param {String} type 下拉列表类型
     * @return {*}
     */
        // async getMarketProjectFirstList(type) {
        //     if (type == 'MarketingProject') {
        //         try {
        //             const result = await FeedBack.FormOptionGetListItemAsync({
        //                 type: type
        //             })
        //             if (result.success) {
        //                 this.marketProjectFirstList = result.data
        //             }
        //         } catch (err) {
        //             console.log(err)
        //         }
        //     } else if (type == 'SourceFeedback') {
        //         try {
        //             const result = await FeedBack.FormOptionGetListItemAsync({
        //                 type: type
        //             })
        //             if (result.success) {
        //                 this.feedBackSourceList = result.data
        //             }
        //         } catch (err) {
        //             console.log(err)
        //         }
        //     } else if (type == 'ImpactCategory') {
        //         try {
        //             const result = await FeedBack.FormOptionGetListItemAsync({
        //                 type: type
        //             })
        //             if (result.success) {
        //                 this.influenceCategory = result.data
        //             }
        //         } catch (err) {
        //             console.log(err)
        //         }
        //     } else if (type == 'MarketingProjectName') {
        //         try {
        //             const result = await FeedBack.FormOptionGetListItemAsync({
        //                 type: type
        //             })
        //             if (result.success) {
        //                 this.MarketingProjectName = result.data
        //             }
        //         } catch (err) {
        //             console.log(err)
        //         }
        //     } else {
        //         try {
        //             const result = await FeedBack.FormOptionGetListItemAsync({
        //                 type: type
        //             })
        //             if (result.success) {
        //                 this.problemTypeList = result.data
        //             }
        //         } catch (err) {
        //             console.log(err)
        //         }
        //     }
        // },

        onSearchInfo() {
            this.$emit('Search')
        },

        /**
     * @description: 持续处理
     * @param {Object} row 操作当前行对象
     */

        seriousDelate(row) {
            const str = JSON.stringify(row)
            this.$refs.SeriousDelateDialog.show(str)
        }
    }
}
</script>
<style scoped lang="less" src="./severePenaltyFeedBack.less"></style>
<style scoped lang="less" src="@/assets/style/feedBackDialog.less"></style>
<style scoped lang="less">
.toPageLink {
  color: #3579e0;
  text-decoration: underline;
  &:hover {
    color: #3579e0;
    cursor: pointer;
  }
}
.FeedbackDatas {
  height: 620px;
  ::v-deep .el-table__body-wrapper {
    height: 520px;
  }

  .option_update {
    background: url('~@/assets/image/options/squireType2.png');

    &.noselect {
      background: url('~@/assets/image/options/Ican_9_Normal@2x.png');

      display: inline-block;
      width: 16px;
      height: 16px;
      position: relative;
      cursor: pointer;
      top: 5px;
      background-size: contain;
    }

    background-size: contain;
  }
  .option_confirm {
    background: url('../../../../../../assets/image/options/circleType8.png');

    &.noselect {
      background: url('~@/assets/image/options/Ican_10_Normal@2x.png');

      display: inline-block;
      width: 16px;
      height: 16px;
      position: relative;
      cursor: pointer;
      top: 5px;
      background-size: contain;
    }

    background-size: contain;
  }
}
</style>
